home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1997 February / WPCFEB97.ISO / dxrs / jukebx02.dxr / 00027_Button Functions.ls < prev    next >
Encoding:
Text File  |  1996-12-09  |  1.7 KB  |  72 lines

  1. on CheckInterfaceButtons
  2.   global gFlagDown, button, FlagClick, leaveTrack, newbut
  3.   if rollOver(27) then
  4.     set the castNum of sprite 27 to the number of member "L Red on"
  5.     updateStage()
  6.   else
  7.     if the castNum of sprite 27 = the number of member "L Red on" then
  8.       set the castNum of sprite 27 to the number of member "L Red off"
  9.       updateStage()
  10.     end if
  11.   end if
  12.   if the mouseDown or (leaveTrack = 1) then
  13.     repeat with r = 27 to 27
  14.       if rollOver(r) or (newbut = r) then
  15.         set newbut to 0
  16.         set leaveTrack to 0
  17.         set the memberNum of sprite r to 7
  18.         set gFlagDown to 1
  19.         set button to r
  20.         ButtonClickDown()
  21.         next repeat
  22.       end if
  23.       set the memberNum of sprite r to 8
  24.     end repeat
  25.   else
  26.     if (gFlagDown = 1) and rollOver(button) then
  27.       ButtonFunction()
  28.       set gFlagDown to 0
  29.       set FlagClick to 0
  30.     end if
  31.   end if
  32. end
  33.  
  34. on ButtonFunction
  35.   global selection, TrayNumber, ButtonNum, button, JUKESoundOne
  36.   case button of
  37.     27:
  38.       set TrayNumber to 10
  39.       set selection to "TRIGCHAN.AIF"
  40.       set ButtonNum to 8
  41.       DoPlay()
  42.   end case
  43. end
  44.  
  45. on DoPlay
  46.   global ButtonNum, button, screen, newbut, leaveTrack
  47.   if screen = 3 then
  48.     set leaveTrack to 0
  49.     PlayRecord()
  50.     set TimeCount to 0
  51.     repeat while soundBusy(1) = 0
  52.       set TimeCount to 1 + TimeCount
  53.       if TimeCount = 400 then
  54.         exit repeat
  55.       end if
  56.     end repeat
  57.     repeat while soundBusy(1)
  58.       rotate()
  59.       ShowImages()
  60.       BubbleAnimation()
  61.       hExit()
  62.       if leaveTrack = 1 then
  63.         exit repeat
  64.       end if
  65.     end repeat
  66.     hExit()
  67.     removeRecord()
  68.     set the memberNum of sprite button to ButtonNum
  69.     ButtonClickUp()
  70.   end if
  71. end
  72.